import admin.User;
import com.sun.org.apache.bcel.internal.generic.NEW;
import mapper.UserMapper;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

public class Demo {
    @Test
    public void test2() {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("beans.xml");
        UserMapper mapper = applicationContext.getBean("userMapper", UserMapper.class);
        List<User> users = mapper.findAll();
        for (User user : users) {
            System.out.println(user);
        }
    }
}
